//1. 导入vue-router相关函数
import { createRouter, createWebHashHistory } from "vue-router";
// 2.路由规则
const routes = [
  {
    path: "/",
    redirect: "/gift",
  },
  {
    path: "/gift",
    name: "gift",
    component: () => import("@/views/pdd/gift.vue"),
  },
  {
    path: "/giftCallback",
    name: "giftCallback",
    component: () => import("@/views/pdd/giftCallback.vue"),
  },
  {
    path: "/jdGift",
    name: "jdGift",
    component: () => import("@/views/jd/jdGift.vue"),
  },
  {
    path: "/jdGiftCallback",
    name: "jdGiftCallback",
    component: () => import("@/views/jd/jdGiftCallback.vue"),
  },
  {
    path: "/code",
    name: "code",
    component: () => import("@/views/code/code.vue"),
  },
  {
    path: "/codeBase",
    name: "codeBase",
    component: () => import("@/views/code/codeBase.vue"),
  },
  {
    path: "/current",
    name: "current",
    component: () => import("@/views/current/index.vue"),
  },
  {
    path: "/currentCallback",
    name: "currentCallback",
    meta: {
      keepAlive: true,
    },
    component: () => import("@/views/current/indexCallback.vue"),
  },
  {
    path: "/currentTip1",
    name: "currentTip1",
    component: () => import("@/views/current/Tip1.vue"),
  },
  {
    path: "/currentTip2",
    name: "currentTip2",
    component: () => import("@/views/current/Tip2.vue"),
  },
  {
    path: "/complaint",
    name: "complaint",
    component: () => import("@/views/current/Complaint.vue"),
  },
  {
    path: "/mt",
    name: "mt",
    component: () => import("@/views/mt/index.vue"),
  },
];
// 3.路由对象实例化
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
// 暴露导出
export default router;
